import 'package:seedfour/generated/json/base/json_field.dart';
import 'package:seedfour/generated/json/payees_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class PayeesEntity {
	String? name;
	List<PayeesItems>? items;

	PayeesEntity();

	factory PayeesEntity.fromJson(Map<String, dynamic> json) => $PayeesEntityFromJson(json);

	Map<String, dynamic> toJson() => $PayeesEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PayeesItems {
	String? uid;
	String? name;
	bool? grouped;
	late List<PayeesItemsOptions> options = [];
	bool? zeroSettle;

	PayeesItems();

	factory PayeesItems.fromJson(Map<String, dynamic> json) => $PayeesItemsFromJson(json);

	Map<String, dynamic> toJson() => $PayeesItemsToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PayeesItemsOptions {
	String? settleMethod;
	int? settleRatio;
	String? desc;

	PayeesItemsOptions();

	factory PayeesItemsOptions.fromJson(Map<String, dynamic> json) => $PayeesItemsOptionsFromJson(json);

	Map<String, dynamic> toJson() => $PayeesItemsOptionsToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}